<% %>
<% if error_messages_for 'user' %>
<div id=Tabs>
     <a href=# onclick="Effect.BlindDown('new_item_form');Element.hide('new_item');"><%='New User'.t%></a>
</div>
  <%= error_messages_for 'user' %>
<% end %>
<br>
<table width=100% class="TimeTrack">
<tr align=left>
   <th><%='SN'.t%></td>
   <th><%='User Name'.t%></td>
   <th><%='Real Name'.t%></td>
   <th><%='Email'.t%></td>
   <th><%='Tel'.t%></td>
   <th><%='Admin'.t%></td>
</tr>
<%@s_user.reload%>
<%@s_user.company.users.each do |u|%>
 <tr id='entry_<%=u.id%>'>
   <td>
   <%=u.sn%>
   </td>
   <td><%=u.username%></td>
   <td><%=u.name%></td>
   <td><%=u.email%></td>
   <td><%=u.tel%></td>
   <td class=action width=7%> 
      <%if u.id == @s_user.id or @s_user.administrator == @s_user%>
      <%=link_to('Edit'.t,:controller=>'user',:action=>'edit',:id=>u.id)%>
      <%=link_to_remote image_tag('trash.gif',:border=>0),
						:confirm=>'Are you sure?'.t,
						:loading=>visual_effect(:highlight,'entry_' + u.id.to_s,:durations=>4.5),
	                    :url=>{:controller=>'user',:action=>'destroy',:id=>u.id}
				%>
	  <%end%>
   </td>
   <!--
   <td>
     <%u.tasks.each do |t|%>
	  <%if t.project%>
      <%#image_tag (t.project.user_is_manager?(u.id)?"Manager":"Employee")+".gif"%> in <%=link_to t.project.name,:controller=>"project",:action=>"show",:id=>t.project.id%><br>
	 <%end%>
	 <%end%>
   </td>
   -->
 </tr>
  <% end %>
<tr><td colspan=6 class=th>
 <%='Users'.t%>:<%=@company.users.size%> 
 <hr>
 <%='Plan'.t%>:<%=@company.plan.name.t%>(
   <%='Users'.t%>:<%=@company.plan.users%>
 )
</td></tr>
</table>

